The file extensions used by the Razor View Engine are different from a web form view engine. It uses cshtml with C# and vbhtml with vb for views, partial view, templates and layout pages.
This Engine is an advanced view engine that was introduced with MVC 3.0. This is not a language but it is markup.
Its syntax that is very compact it helps us to reduce typing.
The Razor Engine supports Test Driven Development (TDD).
Razor uses "@* … *@" for multiline comments.
It have only three transition characters with the Razor View Engine.
ASPX View Engine (Web form view engine)
The namespace used by the ASPX View Engine is System.Web.Mvc.WebFormViewEngine.
The file extensions used by the Web Form View Engines are like ASP.Net web forms. It uses the ASPX extension to view the aspx extension for partial views or User Controls or templates and master extensions for layout/master pages.
Web form view engine is the default view engine and available from the beginning of MVC
Web form view engine has syntax that is the same as an ASP.Net forms application.
The ASPX/web form view engine uses "<%= %>" or "<%: %>" to render server-side content.
It requires the code block to be closed properly otherwise it throws a runtime exception.
Liked By
Write Answer
Differences between Razor and ASPX View Engine in MVC?
Join MindStick Community
You have need login or register for voting of answers or question.
Manish Kumar
04-Jun-2017Razor View Engine VS ASPX View Engine
Razor View Engine
Razor View Engine uses System.Web.Razor namespace.
The file extensions used by the Razor View Engine are different from a web form view engine. It uses cshtml with C# and vbhtml with vb for views, partial view, templates and layout pages.
This Engine is an advanced view engine that was introduced with MVC 3.0. This is not a language but it is markup.
Its syntax that is very compact it helps us to reduce typing.
The Razor Engine supports Test Driven Development (TDD).
Razor uses "@* … *@" for multiline comments.
It have only three transition characters with the Razor View Engine.
ASPX View Engine (Web form view engine)
The namespace used by the ASPX View Engine is System.Web.Mvc.WebFormViewEngine.
The file extensions used by the Web Form View Engines are like ASP.Net web forms. It uses the ASPX extension to view the aspx extension for partial views or User Controls or templates and master extensions for layout/master pages.
Web form view engine is the default view engine and available from the beginning of MVC
Web form view engine has syntax that is the same as an ASP.Net forms application.
The ASPX/web form view engine uses "<%= %>" or "<%: %>" to render server-side content.
It requires the code block to be closed properly otherwise it throws a runtime exception.